package model;

import java.util.Map;
import java.util.Set;
import java.util.TreeMap;

import utils.IFormatter;

/**
 * prende stringhe fresche formattate in mappe(liste)
 * e scambia le chiavi coi valori dalla mappa ricevuta
 * in quella nuova ordinata
 * 
 * @author koelio
 * @see IFormatted
 * @see Formatted per il formato e le mappe;
 * 
 */
public class TeamChart {

	IFormatter formatted;
	Map<Integer, String> orderedmap;

	public TeamChart(IFormatter formatted) {
		super();
		this.formatted = formatted;

		Map<String, Integer> rounds = formatted.getRounds();

		Set<String> keys = rounds.keySet();

		this.orderedmap = new TreeMap<Integer, String>();

		for (String key : keys) {
			int value = rounds.get(key);
			orderedmap.put(value, key);
		}

	}

	public Map<Integer, String> getTeamChart() {
		return this.orderedmap;
	}

}
